<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>首页</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>
<div id="top" align="center" style="height:8%;width: 99%;border:none;margin: 5px auto;padding: 0px;background-color: rgba(90,203,255,0.28)">
    <div style="height: 7px"></div>
    <img style="height: 35px;width: auto;margin-left: 33%" src="/icon/logo.png"/>
    <img style="height: 35px;width: auto;margin-right: 30%" src="/icon/title.png"/>
</div>
<div style="margin: 10px 2% 0px 2%;">
    <div style="float:left;width: 32%;border: 2px solid;border-color: #307ECC;margin-right: 0.7%">
        <div style="height: 40px;width: 100%;background-color: #307ECC;text-align: left">
            <span style="color: #fff;font-size: 16px;margin-left: 10px;line-height: 40px">登录</span>
        </div>

        <c:if test="${empty tip}">
            <div style="margin: 24px 3% 15px 3%">
                <div style="font-size: 19px;color: #3c6797;"><img style="height: 30px;width: 40px;float: left" src="/icon/logo.png"/><div style="margin:13px 0px 0px 5px;float: left">欢迎使用信息反馈平台</div></div>
                <hr style="margin: 4px auto 18px;color: #cecece">
                <form action="/user/login">
                    <input style="width: 90%;height:35px;border: 1px solid;border-right:0px;border-color: #cecece;margin-bottom: 7px;float: left"
                           type="text" name="username" placeholder="&nbsp;&nbsp;用户名">
                    <div style="height: 33px;width: 9%;border: 1px solid;border-color: #cecece;border-left: 0px;float: left;">
                        <img style="height: 15px;width: 15px;margin-right: 8px;float: right" src="/icon/user.png"></div>
                    <br>
                    <input style="width: 90%;height:35px;border: 1px solid;border-right:0px;border-color: #cecece;float: left"
                           type="password" name="password" placeholder="&nbsp;&nbsp;密码">
                    <div style="height: 33px;width: 9%;border: 1px solid;border-color: #cecece;border-left: 0px;float: left;">
                        <img style="height: 15px;width: 15px;margin-right: 8px;float: right" src="/icon/locked.png">
                    </div>
                    <br>
                    <div style="clear: both"></div>
                    <div style="margin-top: 18px">
                        <button class="layui-btn layui-btn-edit" type="submit" style="width: 34%;float: left">登录
                        </button>
                        <button class="layui-btn layui-btn-normal" type="reset"
                                style="width: 34%;float: right;margin-right: 1%">重置
                        </button>
                    </div>
                    <div style="height: 38px"></div>
                </form>
            </div>
        </c:if>

        <c:if test="${!empty tip}">
            <div style="margin: 24px 3% 15px 3%">
                <div style="font-size: 19px;color: #3c6797;">欢迎使用信息反馈平台</div>
                <hr style="margin: 4px auto 18px;color: #cecece">
                <c:if test="${tip=='用户名或密码错误'}">
                    <button class="layui-btn layui-btn-normal"
                            style="height: 35px;width: 100%;background-color: rgba(200,0,0,0.82);">${tip}</button>
                    <div style="height:1px;border:none;border-top:1px dashed #cecece;margin: 18px auto 25px;"></div>
                    <a style="width: 100%;height: 35px;line-height: 35px" class="layui-btn layui-btn-normal"
                       href="/user/index/welcome">返回</a>
                </c:if>

                <c:if test="${tip=='此用户已被禁用'}">
                    <button class="layui-btn layui-btn-normal"
                            style="height: 35px;width: 100%;background-color: #808080;">${tip}</button>
                    <div style="height:1px;border:none;border-top:1px dashed #cecece;margin: 18px auto 25px;"></div>
                    <a style="width: 100%;height: 35px;line-height: 35px" class="layui-btn layui-btn-normal"
                       href="/user/index/welcome">返回</a>
                </c:if>

                <c:if test="${tip=='success'}">
                    <button class="layui-btn layui-btn-normal"
                            style="height: 35px;width: 100%;background-color: green">
                        欢迎：${user.role}</button>
                    <div style="height:1px;border:none;border-top:1px dashed #cecece;margin: 18px auto 25px;"></div>
                    <a style="width: 100%;height: 35px;line-height: 35px" class="layui-btn layui-btn-normal"
                       href="/user/main">进入平台</a>
                </c:if>

                <div style="height: 20px"></div>
            </div>
        </c:if>

    </div>

    <c:forEach items="${columns}" var="column1" end="1">
        <div style="float:left;width: 32%;border: 2px solid;margin-right: 0.7%;border-color: ${column1.cstyle}">
            <div style="height: 40px;width: 100%;background-color: ${column1.cstyle};text-align: left">
                <span style="color: #fff;font-size: 16px;margin-left: 10px;line-height: 40px">${column1.cname}</span>
            </div>
            <div style="width: 100%;font-size: 14px;margin-top: 10px">${column1.content}</div>
        </div>
    </c:forEach>
</div>
<div style="clear: both"></div>
<div style="margin: 10px 2% 0px 2%;">
    <c:forEach items="${columns}" var="column2" begin="2">
        <div style="float:left;width: 32%;border: 2px solid;margin-right: 0.7%;border-color: ${column2.cstyle}">
            <div style="height: 40px;width: 100%;background-color: ${column2.cstyle};text-align: left">
                <span style="color: #fff;font-size: 16px;margin-left: 10px;line-height: 40px">${column2.cname}</span>
            </div>
            <div style="width: 100%;font-size: 14px;margin-top: 10px">${column2.content}</div>
        </div>
    </c:forEach>
</div>
</body>
</html>